package router

import (
	"family-doctor/api/handler"
	"github.com/cheng1005/XxCh-Common/pkg"
	"github.com/gin-gonic/gin"
)

func LoadRoutes(r *gin.Engine) {
	apiRouter := r.Group("/api")
	{
		userRouter := apiRouter.Group("/user")
		{
			userRouter.POST("/login", handler.UserLogin)
		}
		r.Use(pkg.JWTAuth("2210a"))
		doctorRouter := apiRouter.Group("/doctor")
		{
			doctorRouter.GET("/info", handler.DoctorInfo)
			doctorRouter.GET("/list", handler.DoctorList)
		}
		eventRouter := apiRouter.Group("/event")
		{
			eventRouter.GET("/info", handler.EventInfo)
			eventRouter.GET("/list", handler.EventList)
		}
		orderRouter := apiRouter.Group("/order")
		{
			orderRouter.POST("/create", handler.OrderCreate)
		}
		
		chatRouter := apiRouter.Group("/chat")
		{
			chatRouter.GET("/ws", handler.Chat)
		}
	}
}
